<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{}},v-for,v-on,v-bind,v-model,v-if</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>

</head>
<body>
<div id="app">
    {{message}}
    <ul>
        <li v-for="todo in todoList">{{todo.text}}</li>
    </ul>
    <button v-on:click="clickMe">点我！</button>
    <button @click="clickMe">clickMe</button>
</div>

<div id="app-2">
  <span v-bind:title="message">
    鼠标悬停几秒钟查看此处动态绑定的提示信息！
  </span>
    <p v-if="seen">你会看见这条的</p>
</div>
<script>
    var app = new Vue({
        el: '#app',//找到元素
        data: {//数据部分
            message: 'hello alice',
            todoList:[{text:'java'},{text:'c++'},{text:'javascript'},{text:'vue'}]
        },
        methods:{
            clickMe:function () {
                alert("你点了一下这个按钮");
            }
        }
    });

    var app2 = new Vue({
        el: '#app-2',
        data: {
            message: '页面加载于 ' + new Date().toLocaleString(),
            seen:true,//控制台输入app2.seen=false不再显示
        }
    });

</script>
</body>
</html>
